package com.le.tester.javaThink.fifth.chapter24_ConcurrentProgramming;

import java.util.concurrent.TimeUnit;

/**
 * createTime：2021/8/17 17:13
 * description：Nap
 */
public class Nap {
    public Nap(double t) {
        try {
            TimeUnit.MICROSECONDS.sleep((int) (1000 * t));
        } catch (Exception e) {
            throw new RuntimeException(e.getMessage());
        }
    }

    public Nap(double t, String msg) {
        this(t);
        System.out.println(msg);
    }
}
